<?php
/* @var $this WineController */
/* @var $model Wine */

$this->breadcrumbs=array(
	'Weine',
);
?>

<br>
<h1>Weinverwaltung</h1>

<?php echo CHtml::button('Neuer Wein', array('submit' => array('wine/create'))); ?>

<br>
<br>
<br>

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'cssFile' => Yii::app()->getRequest()->getBaseUrl() . '/css/tableStyle_align_left.css',
	'id'=>'wine-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'selectableRows'=>1,
	//'selectionChanged'=>'function(id){alert($.fn.yiiGridView.getSelection(id));}',
	'columns'=>array(
        'amount',
        'product_information',
        'vint',
        array(
            'name'=>'Wine.buying_price',
            'value'=>'Yii::app()->format->formatNumber($data->buying_price)',
        ),
        array(
            'name'=>'Wine.sale_price_net',
            'value'=>'Yii::app()->format->formatNumber($data->sale_price_net)',
        ),
        array (
            'class'=>'CButtonColumn',
            'template'=>'{update}{delete}',
            'buttons'=>array(
            	'update'=>array(
            		'imageUrl'=>Yii::app()->request->baseUrl.'/images/update.png',
            	),
            	'delete'=>array(
            		'imageUrl'=>Yii::app()->request->baseUrl.'/images/delete.png',
            	),
            ),
        ),
	),
)); ?>
